<?php
/**
 * UserService.php
 *
 * @author yanyan <yanyan.shen@ht-med.com>
 * @copyright (c) 2021/7/12, HT-MED
 * @since version 1.0
 * Created on 2021/7/12 下午5:17
 */
namespace common\logic\hprose\user;

use common\models\Project;
use common\models\User;

class UserService{
    /**
     * 查询用户信息
     * @param array $data
     * @return int
     */
    public function getUserInfo($data) {
        $info = User::find()->where($data)->asArray()->one();
        return returnJsonData(200, 'ok', $info);
    }
    
    /**
     * 查询用户信息
     * @param array $data
     * @return int
     */
    public function getProjectList($where, $offset, $limit, $order) {
        // 查询数据
        $data = array();
        $query = Project::find()->andWhere($where);
        $data['total'] = $query->count();
        // 查询数据条数
        $data['info'] = $query->offset($offset)->limit($limit)->orderBy($order)->asArray()->all();
        return returnJsonData('ok', $data);
    }
    
    public function test() {
    
    }
}